



<!doctype html>
<html lang="en" class="no-js">
  <head>
    
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      <meta http-equiv="x-ua-compatible" content="ie=edge">
      
        <meta name="description" content="Here you can find all documents about QTrobot.">
      
      
        <link rel="canonical" href="https://luxai-qtrobot.github.io/api/">
      
      
        <meta name="author" content="QTrobot">
      
      
        <meta name="lang:clipboard.copy" content="Copy to clipboard">
      
        <meta name="lang:clipboard.copied" content="Copied to clipboard">
      
        <meta name="lang:search.language" content="en">
      
        <meta name="lang:search.pipeline.stopwords" content="True">
      
        <meta name="lang:search.pipeline.trimmer" content="True">
      
        <meta name="lang:search.result.none" content="No matching documents">
      
        <meta name="lang:search.result.one" content="1 matching document">
      
        <meta name="lang:search.result.other" content="# matching documents">
      
        <meta name="lang:search.tokenizer" content="[\s\-]+">
      
      <link rel="shortcut icon" href="../img/luxai-favicon.ico">
      <meta name="generator" content="mkdocs-1.1, mkdocs-material-4.6.3">
    
    
      
        <title>API Reference - QTrobot Documentation</title>
      
    
    
      <link rel="stylesheet" href="../assets/stylesheets/application.adb8469c.css">
      
        <link rel="stylesheet" href="../assets/stylesheets/application-palette.a8b3c06d.css">
      
      
        
        
        <meta name="theme-color" content="#3f51b5">
      
    
    
      <script src="../assets/javascripts/modernizr.86422ebf.js"></script>
    
    
      
        <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
        <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
        <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
      
    
    <link rel="stylesheet" href="../assets/fonts/material-icons.css">
    
    
      <link rel="stylesheet" href="../stylesheets/extra.css">
    
    
      
    
    
  </head>
  
    
    
    <body dir="ltr" data-md-color-primary="indigo" data-md-color-accent="indigo">
  
    <svg class="md-svg">
      <defs>
        
        
      </defs>
    </svg>
    <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
    <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
    <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
    
      <a href="#api-reference" tabindex="0" class="md-skip">
        Skip to content
      </a>
    
    
      <header class="md-header" data-md-component="header">
  <nav class="md-header-nav md-grid">
    <div class="md-flex">
      <div class="md-flex__cell md-flex__cell--shrink">
        <a href="https://luxai-qtrobot.github.io/" title="QTrobot Documentation" aria-label="QTrobot Documentation" class="md-header-nav__button md-logo">
          
            <img alt="logo" src="../img/logo_luxai_white.png" width="24" height="24">
          
        </a>
      </div>
      <div class="md-flex__cell md-flex__cell--shrink">
        <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
      </div>
      <div class="md-flex__cell md-flex__cell--stretch">
        <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
          
            <span class="md-header-nav__topic">
              QTrobot Documentation
            </span>
            <span class="md-header-nav__topic">
              
                API Reference
              
            </span>
          
        </div>
      </div>
      <div class="md-flex__cell md-flex__cell--shrink">
        
          <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
          
<div class="md-search" data-md-component="search" role="dialog">
  <label class="md-search__overlay" for="__search"></label>
  <div class="md-search__inner" role="search">
    <form class="md-search__form" name="search">
      <input type="text" class="md-search__input" aria-label="search" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
      <label class="md-icon md-search__icon" for="__search"></label>
      <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
        &#xE5CD;
      </button>
    </form>
    <div class="md-search__output">
      <div class="md-search__scrollwrap" data-md-scrollfix>
        <div class="md-search-result" data-md-component="result">
          <div class="md-search-result__meta">
            Type to start searching
          </div>
          <ol class="md-search-result__list"></ol>
        </div>
      </div>
    </div>
  </div>
</div>
        
      </div>
      
    </div>
  </nav>
</header>
    
    <div class="md-container">
      
        
      
      
      <main class="md-main" role="main">
        <div class="md-main__inner md-grid" data-md-component="container">
          
            
              <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    <nav class="md-nav md-nav--primary" data-md-level="0">
  <label class="md-nav__title md-nav__title--site" for="__drawer">
    <a href="https://luxai-qtrobot.github.io/" title="QTrobot Documentation" class="md-nav__button md-logo">
      
        <img alt="logo" src="../img/logo_luxai_white.png" width="48" height="48">
      
    </a>
    QTrobot Documentation
  </label>
  
  <ul class="md-nav__list" data-md-scrollfix>
    
      
      
      


  <li class="md-nav__item">
    <a href=".." title="Home" class="md-nav__link">
      Home
    </a>
  </li>

    
      
      
      


  <li class="md-nav__item">
    <a href="../user-manual/" title="Quick Start" class="md-nav__link">
      Quick Start
    </a>
  </li>

    
      
      
      

  


  <li class="md-nav__item md-nav__item--active">
    
    <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
    
      
    
    
      <label class="md-nav__link md-nav__link--active" for="__toc">
        API Reference
      </label>
    
    <a href="./" title="API Reference" class="md-nav__link md-nav__link--active">
      API Reference
    </a>
    
      
<nav class="md-nav md-nav--secondary">
  
  
    
  
  
    <label class="md-nav__title" for="__toc">Table of contents</label>
    <ul class="md-nav__list" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#qtrobot-interface" class="md-nav__link">
    QTrobot Interface
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1-naming-convention" class="md-nav__link">
    1. Naming convention
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-accessing-qtrobot-interface-from-bash" class="md-nav__link">
    2. Accessing QTrobot interface from bash
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3-accessing-qtrobot-interface-from-a-python-script" class="md-nav__link">
    3. Accessing QTrobot interface from a python script
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#4-list-of-available-interfaces" class="md-nav__link">
    4. List of available interfaces
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#41-speech-interface" class="md-nav__link">
    4.1 Speech Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#42-audio-interface" class="md-nav__link">
    4.2 Audio Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#43-emotion-interface" class="md-nav__link">
    4.3 Emotion Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#44-gesture-interface" class="md-nav__link">
    4.4 Gesture Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#45-behavior-interface" class="md-nav__link">
    4.5 Behavior Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#46-motor-interface" class="md-nav__link">
    4.6 Motor Interface
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#461-qtrobot-parts" class="md-nav__link">
    4.6.1 QTrobot parts
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#47-setting-interface" class="md-nav__link">
    4.7 Setting Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#48-human-3d-tracking-interface" class="md-nav__link">
    4.8 Human 3D Tracking Interface
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#5-tutorials" class="md-nav__link">
    5. Tutorials
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
      
      
      
      
    </ul>
  
</nav>
    
  </li>

    
      
      
      


  <li class="md-nav__item md-nav__item--nested">
    
      <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4">
    
    <label class="md-nav__link" for="nav-4">
      FAQ
    </label>
    <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
      <label class="md-nav__title" for="nav-4">
        FAQ
      </label>
      <ul class="md-nav__list" data-md-scrollfix>
        
        
          
          
          


  <li class="md-nav__item">
    <a href="../FAQ/Audio/" title="Audio" class="md-nav__link">
      Audio
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../FAQ/Autostart/" title="Autostart" class="md-nav__link">
      Autostart
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../FAQ/Motors/" title="Motors" class="md-nav__link">
      Motors
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../FAQ/Network/" title="Network" class="md-nav__link">
      Network
    </a>
  </li>

        
          
          
          


  <li class="md-nav__item">
    <a href="../FAQ/Miscellaneous/" title="Miscellaneous" class="md-nav__link">
      Miscellaneous
    </a>
  </li>

        
      </ul>
    </nav>
  </li>

    
      
      
      


  <li class="md-nav__item">
    <a href="../demos/" title="Demos" class="md-nav__link">
      Demos
    </a>
  </li>

    
      
      
      


  <li class="md-nav__item">
    <a href="../examples/" title="Examples" class="md-nav__link">
      Examples
    </a>
  </li>

    
      
      
      


  <li class="md-nav__item">
    <a href="../author-note/" title="Author's Note" class="md-nav__link">
      Author's Note
    </a>
  </li>

    
  </ul>
</nav>
                  </div>
                </div>
              </div>
            
            
              <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
                <div class="md-sidebar__scrollwrap">
                  <div class="md-sidebar__inner">
                    
<nav class="md-nav md-nav--secondary">
  
  
    
  
  
    <label class="md-nav__title" for="__toc">Table of contents</label>
    <ul class="md-nav__list" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#qtrobot-interface" class="md-nav__link">
    QTrobot Interface
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#1-naming-convention" class="md-nav__link">
    1. Naming convention
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#2-accessing-qtrobot-interface-from-bash" class="md-nav__link">
    2. Accessing QTrobot interface from bash
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#3-accessing-qtrobot-interface-from-a-python-script" class="md-nav__link">
    3. Accessing QTrobot interface from a python script
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#4-list-of-available-interfaces" class="md-nav__link">
    4. List of available interfaces
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#41-speech-interface" class="md-nav__link">
    4.1 Speech Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#42-audio-interface" class="md-nav__link">
    4.2 Audio Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#43-emotion-interface" class="md-nav__link">
    4.3 Emotion Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#44-gesture-interface" class="md-nav__link">
    4.4 Gesture Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#45-behavior-interface" class="md-nav__link">
    4.5 Behavior Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#46-motor-interface" class="md-nav__link">
    4.6 Motor Interface
  </a>
  
    <nav class="md-nav">
      <ul class="md-nav__list">
        
          <li class="md-nav__item">
  <a href="#461-qtrobot-parts" class="md-nav__link">
    4.6.1 QTrobot parts
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#47-setting-interface" class="md-nav__link">
    4.7 Setting Interface
  </a>
  
</li>
        
          <li class="md-nav__item">
  <a href="#48-human-3d-tracking-interface" class="md-nav__link">
    4.8 Human 3D Tracking Interface
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
        
          <li class="md-nav__item">
  <a href="#5-tutorials" class="md-nav__link">
    5. Tutorials
  </a>
  
</li>
        
      </ul>
    </nav>
  
</li>
      
      
      
      
      
    </ul>
  
</nav>
                  </div>
                </div>
              </div>
            
          
          <div class="md-content">
            <article class="md-content__inner md-typeset">
              
                
                
                <h1 id="api-reference"><strong>API Reference</strong></h1>
<hr />
<h2 id="qtrobot-interface"><strong>QTrobot Interface</strong></h2>
<p>The <a href="http://www.luxai.com">QTrobot (LuxAI)</a> interface aims to facilitate accessing basic robot functionalities leveraging a set of user-friendly ROS interfaces. Each robot’s functionality can be accessed in blocking and non-blocking mode using ROS publish/subscribe and Service/Client interfaces. Following are the main interfaces of QTrobot:</p>
<ul>
<li><strong><em>QTrobot Emotion</em></strong> : implements robot facial emotion</li>
<li><strong><em>QTrobot Speech</em></strong> : implements robot text to speech functionality</li>
<li><strong><em>QTrobot Audio</em></strong> : implement a simple player to play standard audio files</li>
<li><strong><em>QTrobot Gesture</em></strong> : implements robot gesture control</li>
<li><strong><em>QTrobot Behavior</em></strong> : implements more complex behaviors by combining 
 the robot basic functionality</li>
<li><strong><em>QTrobot Motor</em></strong> : implements robot motor controls using standard <a href="http://wiki.ros.org/ros_control">ros_control</a></li>
<li><strong><em>QTrobot 3D Camera</em></strong> : implements different human 3D body and facial 
 tracking including human full body skeleton, hands pos and gestures, facial and emotion recognition using Intel Realsense camera and <a href="https://nuitrack.com/" title="wikilink">Nuitrack SDK</a></li>
<li><strong><em>QTrobot Settings</em></strong> : implements some basic setting of robot such as speaker volume control</li>
</ul>
<p>and some extra interfaces which are available for some models of
QTrobot:</p>
<p>For each of the main interfaces, there are two different way of
accessing them:</p>
<ol>
<li><strong><em>Using ROS Publisher/Subscribers to allow non-blocking call to the interfaces</em></strong></li>
<li><strong><em>Using ROS Services for blocking and accessing more sophisticated interfaces</em></strong></li>
</ol>
<hr />
<h3 id="1-naming-convention"><strong>1. Naming convention</strong></h3>
<p>All the QTRobot ROS interfaces have <strong>'/qt_robot/...'</strong> prefix in front of their names. The word follows the prefix is the name of the main service (e.g. <strong>'/qt_robot/speech/...'</strong>). Each interface may have more sub-services (methods) which come after the main service name. For example:</p>
<ul>
<li><strong>/qt_robot/speech/say</strong>    : implements say() method of QTrobot TTS</li>
<li><strong>/qt_robot/speech/config</strong> : implements configure() method of QTrobot TTS</li>
</ul>
<p>For user’s convenience we have given the same name to the service and subscriber for each QTrobot ROS interface. That means one can access, for example, the speech functionality using ROS service call or publish/subscribe via the same interface name (e.g. <strong>'/qt_robot/speech/say'</strong>). Please notice that some of the complex services (e.g. speech configuration for language, pitch,…) are accessible only via ROS service call.</p>
<hr />
<h3 id="2-accessing-qtrobot-interface-from-bash"><strong>2. Accessing QTrobot interface from bash</strong></h3>
<p>You can access each Robot functionality via its publish/subscribe or Service/Client interfaces. For example to use robot <strong>'Speech'</strong> functionality you can try the following:</p>
<p>Using ROS Publisher
<div class="codehilite"><pre><span></span><code>$ rostopic pub /qt_robot/speech/say std_msgs/String <span class="s2">&quot;data: &#39;I am QT&#39;&quot;</span>
</code></pre></div></p>
<p>Using ROS Service
<div class="codehilite"><pre><span></span><code>$ rosservice call /qt_robot/speech/say <span class="s2">&quot;message: &#39;I am QT.&#39;&quot;</span>
</code></pre></div></p>
<hr />
<h3 id="3-accessing-qtrobot-interface-from-a-python-script"><strong>3. Accessing QTrobot interface from a python script</strong></h3>
<p><strong>[Non-blocking mode]</strong> The following example shows how to access
QTrobot <em>Speech</em> functionality using ROS publish/subscribe method from
python:</p>
<p><div class="codehilite"><pre><span></span><code><span class="kn">import</span> <span class="nn">rospy</span>
<span class="kn">from</span> <span class="nn">std_msgs.msg</span> <span class="kn">import</span> <span class="n">String</span>

<span class="c1"># create a publisher</span>
<span class="n">speechSay_pub</span> <span class="o">=</span> <span class="n">rospy</span><span class="o">.</span><span class="n">Publisher</span><span class="p">(</span><span class="s1">&#39;/qt_robot/speech/say&#39;</span><span class="p">,</span> <span class="n">String</span><span class="p">,</span> <span class="n">queue_size</span><span class="o">=</span><span class="mi">10</span><span class="p">)</span>
<span class="o">...</span>
<span class="c1"># publish a text message to TTS (non-blocking)</span>
<span class="n">speechSay_pub</span><span class="o">.</span><span class="n">publish</span><span class="p">(</span><span class="s2">&quot;Hello! I am QT!&quot;</span><span class="p">)</span>
</code></pre></div>
 <strong>[Blocking mode]</strong> And the following example, re-implements the
previous one using ROS Service/Client method from python:</p>
<div class="codehilite"><pre><span></span><code><span class="kn">import</span> <span class="nn">rospy</span>
<span class="kn">from</span> <span class="nn">std_msgs.msg</span> <span class="kn">import</span> <span class="n">String</span>
<span class="kn">from</span> <span class="nn">qt_robot_interface.srv</span> <span class="kn">import</span> <span class="o">*</span>

<span class="c1"># create a service clients</span>
<span class="n">speechSay</span> <span class="o">=</span> <span class="n">rospy</span><span class="o">.</span><span class="n">ServiceProxy</span><span class="p">(</span><span class="s1">&#39;/qt_robot/speech/say&#39;</span><span class="p">,</span> <span class="n">speech_say</span><span class="p">)</span>
<span class="o">...</span>
<span class="c1"># call the service (blocking)</span>
<span class="n">resp</span> <span class="o">=</span> <span class="n">speechSay</span><span class="p">(</span><span class="s2">&quot;Hello! I am QT.&quot;</span><span class="p">)</span>
</code></pre></div>

<div class="admonition warning">
<p class="admonition-title">Notice</p>
<p><strong><em>All QTrobot service interfaces returns the status of the call upun success or failure. For example to check whether a call to a service was successful in python, you can check the return value resp.status.</em></strong></p>
</div>
<hr />
<h3 id="4-list-of-available-interfaces"><strong>4. List of available interfaces</strong></h3>
<p>Currently the following interfaces have been implemented:</p>
<table>
<thead>
<tr>
<th><strong>INTERFACES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Functionality</strong></td>
<td><strong>Interface prefix</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td><a href="#41-speech-interface">Speech</a></td>
<td>/qt_robot/speech/...</td>
<td>robot text to speech functionality</td>
</tr>
<tr>
<td><a href="#42-audio-interface">Audio</a></td>
<td>/qt_robot/audio/...</td>
<td>simple standard audio file player</td>
</tr>
<tr>
<td><a href="#43-emotion-interface">Emotion</a></td>
<td>/qt_robot/emotion/...</td>
<td>robot facial emotion</td>
</tr>
<tr>
<td><a href="#44-gesture-interface">Gesture</a></td>
<td>/qt_robot/gesture/...</td>
<td>robot gesture control</td>
</tr>
<tr>
<td><a href="#45-behavior-interface">Behavior</a></td>
<td>/qt_robot/behavior/...</td>
<td>more complex behaviors by combining the robot basic functionality</td>
</tr>
<tr>
<td><a href="#46-motor-interface">Motor</a></td>
<td>/qt_robot/motor/...</td>
<td>robot motor controls using standard <a href="http://wiki.ros.org/ros_control"><strong><em>ros_control</em></strong></a></td>
</tr>
<tr>
<td><a href="#47-setting-interface">Setting</a></td>
<td>/qt_robot/setting/...</td>
<td>basic setting of robot such as speaker volume control</td>
</tr>
<tr>
<td><a href="#48-human-3d-tracking-interface">Human 3D Skeleton</a></td>
<td>/qt_nuitrack_app/skeletons</td>
<td>Human full body skeleton information</td>
</tr>
<tr>
<td><a href="#48-human-3d-tracking-interface">Human 3D Hand Pos</a></td>
<td>/qt_nuitrack_app/hands</td>
<td>Human 3D hand pos and state</td>
</tr>
<tr>
<td><a href="#48-human-3d-tracking-interface">Human Hand Gestures</a></td>
<td>/qt_nuitrack_app/gestures</td>
<td>Some basic human gestures recognition</td>
</tr>
<tr>
<td><a href="#48-human-3d-tracking-interface">Human facial</a></td>
<td>/qt_nuitrack_app/faces</td>
<td>human face detection, orientation, eyes and facial features pos, age/gender detection and facial emotion recognition</td>
</tr>
</tbody>
</table>
<hr />
<h4 id="41-speech-interface"><strong>4.1 Speech Interface</strong></h4>
<p>This interface implements QTrobot text to speech functionality which support many languages. The supported languages can be different for each robot. following are some standard supported languages:</p>
<ul>
<li><strong>en-US</strong> (american english)</li>
<li><strong>en-GB</strong> (british english)</li>
<li><strong>fr-FR</strong> (French)</li>
<li><strong>de-DE</strong> (German)</li>
</ul>
<table>
<thead>
<tr>
<th><strong>SUBSCRIBERS</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Data Type</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/speech/say</td>
<td>'std_msgs/String' (text)</td>
<td>Read a text using built-in TTS</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>SERVICES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Service Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/speech/say</td>
<td>'speech_say'</td>
<td>message</td>
<td>Read a text using built-in TTS</td>
</tr>
<tr>
<td>/qt_robot/speech/config</td>
<td>'speech_config'</td>
<td>'language', 'pitch', 'speed'</td>
<td>Configure TTS</td>
</tr>
<tr>
<td>/qt_robot/speech/stop</td>
<td>'speech_stop'</td>
<td></td>
<td>Stops current speech activity.</td>
</tr>
</tbody>
</table>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p><strong><em>Default language is set in '/opt/ros/kinetic/share/qt_robot_interface/config/qtrobot-interface.yaml'. the default pitch is usually '140' and speed is '80'. When calling 'speech_config', leave pitch and speed parameters to '0' if you do not want to change them.</em></strong></p>
</div>
<hr />
<h4 id="42-audio-interface"><strong>4.2 Audio Interface</strong></h4>
<p>Play a standard audio file (e.g. wav, mp3). The audio file can be given using its complete name (with the file extension) such as <strong>happy.mp3</strong> or simply without the file extension: <strong>happy</strong>. In the second case, the player first looks for happy.mp3 to play and if it is not found it then tries with happy.wavand so on.</p>
<table>
<thead>
<tr>
<th><strong>SUBSCRIBERS</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Data Type</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/audio/play</td>
<td>'std_msgs/String' (audio file name)</td>
<td>Play an sudio file</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>SERVICES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Service Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/audio/play</td>
<td>'audio_play'</td>
<td>'filename', 'filepath'</td>
<td>Play an audio file given by its filename and filepath</td>
</tr>
<tr>
<td>/qt_robot/audio/stop</td>
<td>'audio_stop'</td>
<td></td>
<td>Stops current audio activity.</td>
</tr>
</tbody>
</table>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p><strong><em>The default path for the audio files is '~/robot/data/audios/'. To play the audio file from the default path, pass an empty string to filepath parameter.</em></strong></p>
</div>
<hr />
<h4 id="43-emotion-interface"><strong>4.3 Emotion Interface</strong></h4>
<p>Change the robot facial emotions such as 'QT/happy', 'QT/sad', etc.</p>
<table>
<thead>
<tr>
<th><strong>SUBSCRIBERS</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Data Type</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/emotion/show</td>
<td>'std_msgs/String' (emotion name)</td>
<td>Show a facial emotion given by its name</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>SERVICES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Service Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/emotion/show</td>
<td>'emotion_show'</td>
<td>'name'</td>
<td>Show a facial emotion given by its name</td>
</tr>
<tr>
<td>/qt_robot/emotion/stop</td>
<td>'emotion_stop'</td>
<td></td>
<td>Stops current emotion activity.</td>
</tr>
</tbody>
</table>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p><strong><em>The complete list of emotion files can be found in '~/robot/data/emotions/'.</em></strong></p>
</div>
<hr />
<h4 id="44-gesture-interface"><strong>4.4 Gesture Interface</strong></h4>
<p>Plays recored robot gesture (arms, head) such as 'happy', 'discust', etc. The complete list of gesture files can be found in <code class="codehilite"><span class="err">~/robot/data/gestures/</span></code>.</p>
<table>
<thead>
<tr>
<th><strong>SUBSCRIBERS</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Data Type</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/gesture/play</td>
<td>'std_msgs/String' (gesture name)</td>
<td>Play a robot gesture given by its name</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>SERVICES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Service Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/gesture/play</td>
<td>'gesture_play'</td>
<td>'name', 'speed'</td>
<td>Play a robot gesture given by its name and speed (default 1.0)</td>
</tr>
<tr>
<td>/qt_robot/gesture/record</td>
<td>'gesture_record'</td>
<td>'parts', 'idleParts'</td>
<td>Start recording a new gesture. 'parts' is a string array of parts name ('head', 'left_arm','right_arm') which specifies which robot part will be used for recording the gesture. 'idleParts' must be set to 'true' to release the motor PWM and put them in idle mode. If not you must put them in idle mode using '/qt_robot/motors/setControlMode' interface</td>
</tr>
<tr>
<td>/qt_robot/gesture/save</td>
<td>'gesture_save'</td>
<td>'name', 'path'</td>
<td>stops the current recording process and save the recorded gesture given by its 'name'. 'path' specifies where to save the gesture instead of the default path</td>
</tr>
<tr>
<td>/qt_robot/gesture/list</td>
<td>'gesture_list'</td>
<td><none></td>
<td>return a list of a the available gestures within the default gesture path</td>
</tr>
<tr>
<td>/qt_robot/gesture/stop</td>
<td>'gesture_stop'</td>
<td></td>
<td>Stops current gesture activity.</td>
</tr>
</tbody>
</table>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p><strong><em>The default value for speed is 1.0 and it is the default speed with which the gesture got recorded.</em></strong></p>
</div>
<div class="admonition warning">
<p class="admonition-title">Notice</p>
<p><strong><em>If the speed param value is 0 the default speed will be used to play the gestures. Default path to record/play the gesture is <code class="codehilite"><span class="err">~/robot/data/gestures/</span></code>.</em></strong></p>
</div>
<hr />
<h4 id="45-behavior-interface"><strong>4.5 Behavior Interface</strong></h4>
<p>This interface implements higher-level and more complex behaviors by combing robot basic functionality.</p>
<table>
<thead>
<tr>
<th><strong>SUBSCRIBERS</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Data Type</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/behavior/talkText</td>
<td>'std_msgs/String' (message)</td>
<td>Read a text using TTS and show talking emotion</td>
</tr>
<tr>
<td>/qt_robot/behavior/talkAudio</td>
<td>'std_msgs/String' (audio filename)</td>
<td>Play an audio file and show talking emotion</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>SERVICES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Service Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/behavior/talkText</td>
<td>'behavior_talk_text'</td>
<td>'message'</td>
<td>Read a text using TTS and show talking emotion</td>
</tr>
<tr>
<td>/qt_robot/behavior/talkAudio</td>
<td>'behavior_talk_audio'</td>
<td>'filename', 'filepath'</td>
<td>Play an audio file and show talking emotion</td>
</tr>
</tbody>
</table>
<div class="admonition info">
<p class="admonition-title">Info</p>
<p><strong><em>To play the audio file from the default path, pass an empty string to filepath param.</em></strong></p>
</div>
<div class="admonition warning">
<p class="admonition-title">Notice</p>
<p><strong><em>The talkAudio and talkText services are mutually exclusive and cannot be used with Emotion Interface at the same time.</em></strong></p>
</div>
<hr />
<h4 id="46-motor-interface"><strong>4.6 Motor Interface</strong></h4>
<p>Motor interface provide access to the robot actuators using standard <a href="http://wiki.ros.org/ros_control">ros_control</a> system. Currently the interface implements ROS 'JointStateController', 'JointGroupPositionController' and a custom 'QTMotorsController' controllers.</p>
<div class="admonition warning">
<p class="admonition-title">Notice</p>
<p><strong><em>Before using the Motor interface, ensure that you fully understood ros_control system and have a clear understanding of what you do at the motor joint level.</em></strong></p>
</div>
<h5 id="461-qtrobot-parts"><strong><em>4.6.1 QTrobot parts</em></strong></h5>
<p>The robot joints are structured as different parts as shown bellow:</p>
<ul>
<li>
<p><strong>head</strong></p>
<ul>
<li><strong>HeadYaw</strong></li>
<li><strong>HeadPitch</strong></li>
</ul>
</li>
<li>
<p><strong>right_arm</strong></p>
<ul>
<li><strong>RightShoulderPitch</strong></li>
<li><strong>RightShoulderRoll</strong></li>
<li><strong>RightElbowRoll</strong></li>
</ul>
</li>
<li>
<p><strong>left_arm</strong></p>
<ul>
<li><strong>LeftShoulderPitch</strong></li>
<li><strong>LeftShoulderRoll</strong></li>
<li><strong>LeftElbowRoll</strong></li>
</ul>
</li>
</ul>
<table>
<thead>
<tr>
<th><strong>SUBSCRIBERS</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Data Type</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/joints/state</td>
<td>sensor_msgs/JointState</td>
<td>publishes joint states (currently only positions)</td>
</tr>
<tr>
<td>/qt_robot/head_position/command</td>
<td>std_msgs/Float64MultiArray</td>
<td>move the robot head to desired position given by (HeadYaw, HeadPitch).</td>
</tr>
<tr>
<td>/qt_robot/right_arm_position/command</td>
<td>std_msgs/Float64MultiArray</td>
<td>move the right_arm to desired position given by (RightShoulderPitch, RightShoulderRoll, RightElbowRoll).</td>
</tr>
<tr>
<td>/qt_robot/left_arm_position/command</td>
<td>std_msgs/Float64MultiArray</td>
<td>move the left_arm to desired position given by (LeftShoulderPitch, LeftShoulderRoll, LeftElbowRoll).</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th><strong>SERVICES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Service Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/motors/home</td>
<td>'home'</td>
<td>'parts'</td>
<td>moves the desired robot part to the home position. 'parts' is an array of robot parts and/or single joint name (e.g.['left_arm', 'right_arm', 'HeadPitch'])</td>
</tr>
<tr>
<td>/qt_robot/motors/setControlMode</td>
<td>'set_control_mode'</td>
<td>'parts'</td>
<td>set the control mode (M_ON=0,M_OFF=1, M_BRAKE=2) of desired robot part. 'parts' is an array of robot parts and/or single joint name (e.g. ['left_arm', 'right_arm', 'HeadPitch']). M_ON: motor is controlled. M_OFF: motor is idle and M_BRAKE: motor is in brake mode (not controlled)</td>
</tr>
<tr>
<td>/qt_robot/motors/setVelocity</td>
<td>'set_velocity'</td>
<td>'parts', 'velocity'</td>
<td>sets the moving velocity of the desired robot part. 'parts' is an array of robot parts and/or single joint name (e.g. ['left_arm', 'right_arm', 'HeadPitch']). 'velocity' is given as percentage.</td>
</tr>
</tbody>
</table>
<div class="admonition warning">
<p class="admonition-title">Notice</p>
<p><strong><em>For safety purpose, every joint has a maximum velocity limits. For example you cannot run 'HeadPitch' joint with more than 20% of the maximum velocity.</em></strong></p>
</div>
<hr />
<h4 id="47-setting-interface"><strong>4.7 Setting Interface</strong></h4>
<p>This interface provides some basic setting of robot such as speaker volume control.</p>
<table>
<thead>
<tr>
<th><strong>SERVICES</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Service Name</strong></td>
<td><strong>Parameters</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_robot/setting/setVolume</td>
<td>'setting_setVolume'</td>
<td>'volume'</td>
<td>set the robot speaker volume to the desired level (in percentage)</td>
</tr>
</tbody>
</table>
<hr />
<h4 id="48-human-3d-tracking-interface"><strong>4.8 Human 3D Tracking Interface</strong></h4>
<p>This interface implements different human 3D body and facial tracking including human full body skeleton, hands pos and gestures, facial and emotion recognition using Intel Realsense camera and <a href="https://nuitrack.com">Nuitrack SDK</a>.</p>
<table>
<thead>
<tr>
<th><strong>PUBLISHERS</strong></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Interface Name</strong></td>
<td><strong>Data Type</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>/qt_nuitrack_app/skeletons</td>
<td>'qt_nuitrack_app/Skeletons'</td>
<td>publishes human full body skeleton information</td>
</tr>
<tr>
<td>/qt_nuitrack_app/hands</td>
<td>'qt_nuitrack_app/Hands'</td>
<td>publishes human 3D hand pos and state</td>
</tr>
<tr>
<td>/qt_nuitrack_app/gestures</td>
<td>'qt_nuitrack_app/Gestures'</td>
<td>publishes some basic human gestures recognition</td>
</tr>
<tr>
<td>/qt_nuitrack_app/faces</td>
<td>'qt_nuitrack_app/Faces'</td>
<td>publishes human face detection, orientation, eyes and facial features pos, age/gender detection and facial emotion recognition</td>
</tr>
<tr>
<td>/camera/color/image_raw</td>
<td>'sensor_msgs/Image'</td>
<td>publishes ROS standard 2D camera image</td>
</tr>
</tbody>
</table>
<hr />
<h3 id="5-tutorials"><strong>5. Tutorials</strong></h3>
<p>Please check our <a href="/demos">Demo</a> and <a href="/examples">Examples</a> sections. You can also check our <a href="https://github.com/luxai-qtrobot/tutorials"><i class="fa fa-github fa-lg github_color"></i> repository</a> for the full list of examples and interesting demos for QTrobot.</p>
                
                  
                
                
                  
                  <hr>
                  <div class="md-source-date">
                    <small>
                      
                        Last update: July 17, 2020
                      
                    </small>
                  </div>
                
              
              
                


              
            </article>
          </div>
        </div>
      </main>
      
        <!--
  Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>

  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to
  deal in the Software without restriction, including without limitation the
  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  sell copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  IN THE SOFTWARE.
-->



<!-- Application footer -->
<footer id="footer" class="md-footer">

  <!-- Link to previous and/or next page -->
  
    <div class="md-footer-nav">
      <nav class="md-footer-nav__inner md-grid">

        <!-- Link to previous page -->
        
          <a href="../user-manual/"
              title="Quick Start"
              class="md-flex md-footer-nav__link md-footer-nav__link--prev"
              rel="prev">
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-back
                    md-footer-nav__button"></i>
            </div>
            <div class="md-flex__cell md-flex__cell--stretch
                  md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  Previous
                </span>
                Quick Start
              </span>
            </div>
          </a>
        

        <!-- Link to next page -->
        
          <a href="../FAQ/Audio/"
              title="Audio"
              class="md-flex md-footer-nav__link md-footer-nav__link--next"
              rel="next">
            <div class="md-flex__cell md-flex__cell--stretch
                  md-footer-nav__title">
              <span class="md-flex__ellipsis">
                <span class="md-footer-nav__direction">
                  Next
                </span>
                Audio
              </span>
            </div>
            <div class="md-flex__cell md-flex__cell--shrink">
              <i class="md-icon md-icon--arrow-forward
                    md-footer-nav__button"></i>
            </div>
          </a>
        
      </nav>
    </div>
  

  <!-- Further information -->
  <div class="md-footer-meta md-typeset">
    <div class="md-footer-meta__inner md-grid">
      <!-- Copyright and theme information -->
      <div class="md-footer-copyright">
        
          <div class="md-footer-copyright__highlight">
            &copy; Copyright &copy; 2020 LuxAI S.A.
          </div>
        
      </div>

      <!-- Social links -->
      
  <div class="md-footer-social">
    <link rel="stylesheet" href="../assets/fonts/font-awesome.css">
    
      <a href="https://github.com/luxai-qtrobot" target="_blank" rel="noopener" title="github" class="md-footer-social__link fa fa-github"></a>
    
      <a href="https://twitter.com/qtrobot" target="_blank" rel="noopener" title="twitter" class="md-footer-social__link fa fa-twitter"></a>
    
      <a href="https://www.linkedin.com/company/luxai/" target="_blank" rel="noopener" title="linkedin" class="md-footer-social__link fa fa-linkedin"></a>
    
      <a href="https://www.facebook.com/luxAI/" target="_blank" rel="noopener" title="facebook" class="md-footer-social__link fa fa-facebook"></a>
    
      <a href="https://www.youtube.com/channel/UCAY0H0HaqQL1GE7lO_iSpbg" target="_blank" rel="noopener" title="youtube" class="md-footer-social__link fa fa-youtube"></a>
    
  </div>

    </div>
  </div>
</footer>
      
    </div>
    
      <script src="../assets/javascripts/application.c33a9706.js"></script>
      
      <script>app.initialize({version:"1.1",url:{base:".."}})</script>
      
        <script src="../javascripts/extra.js"></script>
      
    
  </body>
</html>